* Indicates where scroll arrows should be placed.
*
* Since: 2.16
+ *
+ * Deprecated: 3.20: the value of this style property is ignored.
**/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_enum ("arrow-placement",
P_("Indicates where scroll arrows should be placed"),
GTK_TYPE_ARROW_PLACEMENT,
GTK_ARROWS_BOTH,
- GTK_PARAM_READABLE));
+ GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
gtk_container_class_install_child_property (container_class,
CHILD_PROP_LEFT_ATTACH,
{
GtkMenuPrivate *priv = menu->priv;
guint scroll_arrow_height;
- GtkArrowPlacement arrow_placement;
gtk_widget_style_get (GTK_WIDGET (menu),
"scroll-arrow-vlength", &scroll_arrow_height,
- "arrow_placement", &arrow_placement,
NULL);
- switch (arrow_placement)
- {
- case GTK_ARROWS_BOTH:
- border->top = priv->upper_arrow_visible ? scroll_arrow_height : 0;
- border->bottom = priv->lower_arrow_visible ? scroll_arrow_height : 0;
- break;
-
- case GTK_ARROWS_START:
- border->top = (priv->upper_arrow_visible ||
- priv->lower_arrow_visible) ? scroll_arrow_height : 0;
- border->bottom = 0;
- break;
-
- case GTK_ARROWS_END:
- border->top = 0;
- border->bottom = (priv->upper_arrow_visible ||
- priv->lower_arrow_visible) ? scroll_arrow_height : 0;
- break;
- }
-
+ border->top = priv->upper_arrow_visible ? scroll_arrow_height : 0;
+ border->bottom = priv->lower_arrow_visible ? scroll_arrow_height : 0;
border->left = border->right = 0;
}
GdkRectangle *lower,
gint *arrow_space)
{
- GtkArrowPlacement arrow_placement;
GtkWidget *widget = GTK_WIDGET (menu);
guint border_width;
gint scroll_arrow_height;
gtk_widget_style_get (widget,
"scroll-arrow-vlength", &scroll_arrow_height,
- "arrow-placement", &arrow_placement,
NULL);
get_menu_padding (widget, &menu_padding);
border->height = gdk_window_get_height (gtk_widget_get_window (widget))
- 2 * border_width - menu_padding.top - menu_padding.bottom;
- switch (arrow_placement)
- {
- case GTK_ARROWS_BOTH:
- upper->x = border->x;
- upper->y = border->y;
- upper->width = border->width;
- upper->height = scroll_arrow_height;
-
- lower->x = border->x;
- lower->y = border->height - border->y - scroll_arrow_height;
- lower->width = border->width;
- lower->height = scroll_arrow_height;
- break;
+ upper->x = border->x;
+ upper->y = border->y;
+ upper->width = border->width;
+ upper->height = scroll_arrow_height;
- case GTK_ARROWS_START:
- upper->x = border->x;
- upper->y = border->y;
- upper->width = border->width / 2;
- upper->height = scroll_arrow_height;
-
- lower->x = border->x + upper->width;
- lower->y = border->y;
- lower->width = border->width - upper->width;
- lower->height = scroll_arrow_height;
- break;
-
- case GTK_ARROWS_END:
- upper->x = border->x;
- upper->y = border->height - scroll_arrow_height;
- upper->width = border->width / 2;
- upper->height = scroll_arrow_height;
-
- lower->x = border->x + upper->width;
- lower->y = border->height - scroll_arrow_height;
- lower->width = border->width - upper->width;
- lower->height = scroll_arrow_height;
- break;
-
- default:
- g_assert_not_reached();
- upper->x = upper->y = upper->width = upper->height = 0;
- lower->x = lower->y = lower->width = lower->height = 0;
- }
+ lower->x = border->x;
+ lower->y = border->height - border->y - scroll_arrow_height;
+ lower->width = border->width;
+ lower->height = scroll_arrow_height;
*arrow_space = scroll_arrow_height;
}
{
GtkMenuPrivate *priv = menu->priv;
gboolean double_arrows;
- GtkArrowPlacement arrow_placement;
gtk_widget_style_get (GTK_WIDGET (menu),
"double-arrows", &double_arrows,
- "arrow-placement", &arrow_placement,
NULL);
- if (arrow_placement != GTK_ARROWS_BOTH)
- return TRUE;
-
return double_arrows || (priv->initially_pushed_in &&
priv->scroll_offset != 0);
}
GdkRectangle *upper,
GdkRectangle *lower)
{
- GtkArrowPlacement arrow_placement;
GtkWidget *widget = GTK_WIDGET (menu);
GdkWindow *window;
gint width, height;
gtk_widget_style_get (widget,
"scroll-arrow-vlength", &scroll_arrow_height,
- "arrow-placement", &arrow_placement,
NULL);
border = gtk_container_get_border_width (GTK_CONTAINER (menu));
gdk_window_get_position (window, &win_x, &win_y);
- switch (arrow_placement)
+ if (upper)
{
- case GTK_ARROWS_BOTH:
- if (upper)
- {
- upper->x = win_x;
- upper->y = win_y;
- upper->width = width;
- upper->height = scroll_arrow_height + border + padding.top;
- }
-
- if (lower)
- {
- lower->x = win_x;
- lower->y = win_y + height - border - padding.bottom - scroll_arrow_height;
- lower->width = width;
- lower->height = scroll_arrow_height + border + padding.bottom;
- }
- break;
-
- case GTK_ARROWS_START:
- if (upper)
- {
- upper->x = win_x;
- upper->y = win_y;
- upper->width = width / 2;
- upper->height = scroll_arrow_height + border + padding.top;
- }
-
- if (lower)
- {
- lower->x = win_x + width / 2;
- lower->y = win_y;
- lower->width = width / 2;
- lower->height = scroll_arrow_height + border + padding.bottom;
- }
- break;
-
- case GTK_ARROWS_END:
- if (upper)
- {
- upper->x = win_x;
- upper->y = win_y + height - border - scroll_arrow_height;
- upper->width = width / 2;
- upper->height = scroll_arrow_height + border + padding.top;
- }
+ upper->x = win_x;
+ upper->y = win_y;
+ upper->width = width;
+ upper->height = scroll_arrow_height + border + padding.top;
+ }
- if (lower)
- {
- lower->x = win_x + width / 2;
- lower->y = win_y + height - border - scroll_arrow_height;
- lower->width = width / 2;
- lower->height = scroll_arrow_height + border + padding.bottom;
- }
- break;
+ if (lower)
+ {
+ lower->x = win_x;
+ lower->y = win_y + height - border - padding.bottom - scroll_arrow_height;
+ lower->width = width;
+ lower->height = scroll_arrow_height + border + padding.bottom;
}
}